package General;

import java.util.Collections;
import java.util.LinkedList;
import java.util.Random;

public class Dice {
	//General purpose entropy tools
	
	public Dice(){
		super();
	}

	public static LinkedList<Integer> chooseCulture(int playerCount){
		//implement a method to randomly choose races, but attempt to force 1 of each race
		//returns an array representing the results of the culture rolls
		
		int sets = playerCount / 3;	//number of sets of cultures required
		int remainder = playerCount%3;	//loose players
		
		LinkedList<Integer> results = new LinkedList<Integer>();
		for(int idx = 0; idx < sets; idx++){
			//load a list with all the races required 
			results.push(0);
			results.push(1);
			results.push(2);
		}
		
		LinkedList<Integer> tempList = new LinkedList<Integer>();
		tempList.push(0);
		tempList.push(1);
		tempList.push(2);
		Collections.shuffle(tempList);
		
		for(int idx = 0; idx < remainder; idx++){
			results.push(tempList.pop());	//move the items into the results list
		}
		
		Collections.shuffle(results);
		return results;
	}
	public static int determineStarting(int i){
		Random rnd = new Random();
		return rnd.nextInt(i);
	}
}
